# DEGs from snRNA-seq data
Bf.combined.youngBrain.r1.markers <- FindAllMarkers(Bf.combined.youngBrain, only.pos = TRUE, logfc.threshold = 0.5, min.pct = 0.25)
DEGs were then filtered using the following criteria: avg_log2FC > 1, pct.1 > 0.25, pct.2 < 0.1
see Data S4 for the DEG list

# DotPlot

Bf.combined.youngBrain$clusterReorder = Bf.combined.youngBrain$integrated_snn_res.1

Bf.combined.youngBrain$clusterReorder = factor(Bf.combined.youngBrain$clusterReorder, levels = c(
"21",
"31",
"33",
"16",
"30",
"35",
"11",
"38",
"6",
"17",
"28",
"15",
"18",
"34",
"13",
"3",
"39",
"9",
"36",
"22",
"7",
"1",
"2",
"8",
"19",
"26",
"4",
"12",
"24",
"5",
"37",
"20",
"27",
"10",
"14",
"32",
"25",
"29",
"0",
"23"
))

DotPlot_scCustom(Bf.combined.youngBrain, group.by = "clusterReorder", features = rev(DEG_ID), x_lab_rotate = T, flip_axes = T)+
  scale_x_discrete(labels = substr(rev(DEG_Name),1 , 55))



# DEGs from Xenium data
xenium.2022.obj.neurons.log.rotated.r1.5.markars <- FindAllMarkers(xenium.2022.obj.neurons.log.rotated, only.pos = TRUE, logfc.threshold = 1)
DEGs were then filtered using the following criteria: avg_log2FC > 1, pct.1 > 0.25, pct.2 < 0.2
see Data S4 for the DEG list

# DotPlots

xenium.2022.obj.neurons.log.rotated$clusterReorder = xenium.2022.obj.neurons.log.rotated$Xenium_snn_res.1.5

xenium.2022.obj.neurons.log.rotated$clusterReorder = factor(xenium.2022.obj.neurons.log.rotated$clusterReorder, levels = c(
"11",
"3",
"33",
"16",
"29",
"26",
"32",
"2",
"17",
"25",
"24",
"6",
"18",
"8",
"9",
"21",
"13",
"19",
"5",
"4",
"35",
"1",
"0",
"10",
"22",
"7",
"15",
"20",
"14",
"12",
"27",
"28",
"23",
"31",
"30",
"34"
))

DotPlot_scCustom(xenium.2022.obj.neurons.log.rotated, group.by = "clusterReorder", features = rev(DEG_ID), x_lab_rotate = T, flip_axes = T)+
  scale_x_discrete(labels = substr(rev(DEG_Name),1 , 55))